package com.jason.designpattern.singleton;

/**
 * @description: 登记式/静态内部类
 * 优点：实现了懒加载；线程安全；高性能
 * @author: jason.jia
 * @create: 2019-03-08 17:16
 **/
public class HolderSingleton {

    private static class SingletonHolder{
        private static final HolderSingleton INSTANCE = new HolderSingleton();
    }

    public HolderSingleton() {
    }

    public static final HolderSingleton getInstance(){
        return SingletonHolder.INSTANCE;
    }
}
